<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<%@page import="org.springframework.core.io.ClassPathResource"%>
<%@page import="org.springframework.beans.factory.xml.XmlBeanFactory"%>
<%@page import="com.zenika.zencontact.model.ContactDao"%>
<%@page import="com.zenika.zencontact.model.Contact"%>
<%
	out.println("Deleting customer...<br>");

	ClassPathResource res = new ClassPathResource(
			"applicationContext.xml");
	XmlBeanFactory factory = new XmlBeanFactory(res);
	ContactDao dao = (ContactDao) factory.getBean("jdbcContactDao");

	try {
		Long id = Long.parseLong(request.getParameter("id"));
		dao.delete(id);

	} catch (Exception e) {
		e.printStackTrace();
	};%>